﻿//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Threading.Tasks;
//using Authorization;
//using Entity.Project;
//using Microsoft.AspNetCore.Http;
//using Microsoft.AspNetCore.Mvc;
//using NetCoreAPI.Socket;

//namespace NetCoreAPI.Controllers.Portal
//{
//    [ApiController]
//    public class TexasHoldEmPokerController : PortalApiController
//    {
//        /// <summary>
//        /// 根据等级获取房间列表
//        /// </summary>
//        /// <param name="level">房间等级</param>
//        /// <returns></returns>
//        [HttpGet]
//        [CheckLogin]
//        public JsonResult GetRoomList(RoomLevel level)
//        {
//            var rooms = SocketHelp.Rooms.Where(x => x.RoomLevel == level);
//            var result = from list in rooms
//                         select new
//                         {
//                             list.Big,
//                             list.Little,
//                             list.MaxJetton,
//                             list.MaxUserNum,
//                             list.MinJetton,
//                             list.RoomKey,
//                             list.RoomLevel,
//                             list.RoomName,
//                             PlayerNum=list.Player.Count
//                         };
//            return new JsonResult(HttpResult.Success(result));
//        }

//        /// <summary>
//        /// 根据房间key查询房间信息
//        /// </summary>
//        /// <param name="key"></param>
//        /// <returns></returns>
//        [HttpGet("{key}")]
//        public JsonResult GetRoomByKey(string key)
//        {
//            var result = SocketHelp.Rooms.Single(x => x.RoomKey == key);
//            if (result!=null)
//            {
//                return new JsonResult(HttpResult.Success(result));
//            }
//            else
//            {
//                return new JsonResult(HttpResult.Success(HttpResultCode.SelectFail, "未获取到房间信息。", new { key}));
//            }
//        }

//    }
//}
